﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Configuration;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Corina.Webservice.Lantern
{
    public partial class PictureLoader : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Unnamed_Click(object sender, EventArgs e)
        {
            //HttpFileCollection fileCollection = Request.Files;

            //Console.WriteLine(string.Join(",", fileCollection.AllKeys));
            try
            {
                string _folder = WebConfigurationManager.AppSettings["directory_upload"] + "MeasurePictures\\";

                string filename = _folder + "1.jpg";
                if (File.Exists(filename))
                {
                    File.Delete(filename);
                }
                uploader.SaveAs(filename);

                labelNotice.Text = "上传成功！";
            }
            catch (Exception ex)
            {
                labelNotice.Text = ex.Message;
            }
        }

        protected void previewButton_Click(object sender, EventArgs e)
        {
            //previewImage.ImageUrl = (FindControl("uploader") as FileUpload).FileName;
        }
    }
}